#include "kdnn.hpp"
#include <vector>
#include <string>
#include <string.h>
#include <unordered_map>
#include <random>
#include <iostream>

static std::unordered_map<std::string, KDNN::Layout> layoutMap = {
    {"KDNN::Layout::UNDEFINED", KDNN::Layout::UNDEFINED},
    {"KDNN::Layout::A", KDNN::Layout::A},
    {"KDNN::Layout::AB", KDNN::Layout::AB},
    {"KDNN::Layout::BA", KDNN::Layout::BA},
    {"KDNN::Layout::ABC", KDNN::Layout::ABC},
    {"KDNN::Layout::ACB", KDNN::Layout::ACB},
    {"KDNN::Layout::BAC", KDNN::Layout::BAC},
    {"KDNN::Layout::BCA", KDNN::Layout::BCA},
    {"KDNN::Layout::CAB", KDNN::Layout::CAB},
    {"KDNN::Layout::CBA", KDNN::Layout::CBA},
    {"KDNN::Layout::ABCD", KDNN::Layout::ABCD},
    {"KDNN::Layout::ABDC", KDNN::Layout::ABDC},
    {"KDNN::Layout::ACBD", KDNN::Layout::ACBD},
    {"KDNN::Layout::ACDB", KDNN::Layout::ACDB},
    {"KDNN::Layout::ADBC", KDNN::Layout::ADBC},
    {"KDNN::Layout::ADCB", KDNN::Layout::ADCB},
    {"KDNN::Layout::BACD", KDNN::Layout::BACD},
    {"KDNN::Layout::BCDA", KDNN::Layout::BCDA},
    {"KDNN::Layout::CDAB", KDNN::Layout::CDAB},
    {"KDNN::Layout::CDBA", KDNN::Layout::CDBA},
    {"KDNN::Layout::DCAB", KDNN::Layout::DCAB},
    {"KDNN::Layout::ABCDE", KDNN::Layout::ABCDE},
    {"KDNN::Layout::ABCED", KDNN::Layout::ABCED},
    {"KDNN::Layout::ABDEC", KDNN::Layout::ABDEC},
    {"KDNN::Layout::ACBDE", KDNN::Layout::ACBDE},
    {"KDNN::Layout::ACDEB", KDNN::Layout::ACDEB},
    {"KDNN::Layout::ADECB", KDNN::Layout::ADECB},
    {"KDNN::Layout::BACDE", KDNN::Layout::BACDE},
    {"KDNN::Layout::BCDEA", KDNN::Layout::BCDEA},
    {"KDNN::Layout::CDEAB", KDNN::Layout::CDEAB},
    {"KDNN::Layout::CDEBA", KDNN::Layout::CDEBA},
    {"KDNN::Layout::DECAB", KDNN::Layout::DECAB},
    {"KDNN::Layout::ROW_MAJOR", KDNN::Layout::ROW_MAJOR},
    {"KDNN::Layout::COL_MAJOR", KDNN::Layout::COL_MAJOR},
    {"KDNN::Layout::NCHW", KDNN::Layout::NCHW},
    {"KDNN::Layout::NHWC", KDNN::Layout::NHWC},
    {"KDNN::Layout::NCDHW", KDNN::Layout::NCDHW},
    {"KDNN::Layout::NDHWC", KDNN::Layout::NDHWC},
    {"KDNN::Layout::OIHW", KDNN::Layout::OIHW},
    {"KDNN::Layout::HWIO", KDNN::Layout::HWIO},
    {"KDNN::Layout::HWOI", KDNN::Layout::HWOI},
    {"KDNN::Layout::OHWI", KDNN::Layout::OHWI},
    {"KDNN::Layout::OHWO", KDNN::Layout::OHWO},
    {"KDNN::Layout::IOHW", KDNN::Layout::IOHW},
};

static std::unordered_map<std::string, KDNN::Element::TypeT> typeTMap = {
    {"UNDEFINED", KDNN::Element::TypeT::UNDEFINED},
    {"KDNN::Element::TypeT::F32", KDNN::Element::TypeT::F32},
    {"KDNN::Element::TypeT::F16", KDNN::Element::TypeT::F16},
    {"KDNN::Element::TypeT::BF16", KDNN::Element::TypeT::BF16},
    {"KDNN::Element::TypeT::S32", KDNN::Element::TypeT::S32},
    {"KDNN::Element::TypeT::S8", KDNN::Element::TypeT::S8},
    {"KDNN::Element::TypeT::U8", KDNN::Element::TypeT::U8},
};

bool kudnn_conv_01();
bool kudnn_conv_02();
bool kudnn_gnorm_01();
bool kudnn_lnorm_01();
bool kudnn_linearActivation_01();
bool kudnn_linearRes_01();
bool kudnn_rnorm_01();
bool kudnn_softmax_01();